package com.learn.springcloud.eurekahaconsumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Time : 2018/7/20 17:58
 * @Version : 1.0
 * @Author : hongyan.li@hand-china.com
 * Copyright @ 2000 Shanghai Hand Co. Ltd.
 * All right reserved.
 */
@RestController
public class HelloUser {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/hello")
    public String sayHello(String name){
        return restTemplate.getForEntity("http://eureka-ha-provider/hello/service",String.class).getBody()+ ", " + name;
    }

}
